# Verification of OpenJDK's LinkedList using KeY (proofs and specifications amenable for client-side reasoning)

The version of KeY that is used, is key-2.8.0 (build 3ddfc1d216)
The version of Java under consideration is 8 (OpenJDK8-b132, see https://hg.openjdk.java.net/jdk8/jdk8/jdk/).

## Source file

The adapted LinkedList with JML specifications is stored in `./src/java/util/BoundedLinkedList.java`. Moreover, in the `./jre/` folder, stub contracts for methods of other classes are present.

## Instructions to replay proof files

To verify the integrity of the bundled proof files, follow these instructions. The hardware requirements are modest, and this part can be run on any recent desktop or laptop machine (e.g. 4 GiB RAM, OpenJDK8 run-time).

1. Extract the `key-2.6.3_7d3deab0763c88edee4f7a08e604661e0dbdd450.zip` file.
2. Open a terminal and change to the directory with this README file.
3. To ensure KeY starts in a fresh state (in particular when multiple KeY versions are present on the system), remove the .key directory from the user's home directory,
   and clean out any existing preferences from the .java/.userPrefs directory by deleting the de/uka/ilkd/key hierarchy containing prefs.xml
4. Run `key-2.8.0-exe.jar`.
5. KeY now starts up and opens a `Load Example` window. Close that window.
6. Select `File` and `Open` from the menu. Navigate to the project folder.
7. Load a proof in the `./proofs/` folder. For example, load:
   `java.util.BoundedLinkedList__addFirst(java.lang.Object).JML normal_behavior operation contract.0.proof`
8. KeY loads the proof file, and shows the proof tree.
9. Check the proof statistics by selecting `Proof` and `Show Proof Statistics` from the menu. For example, for the main contract of the add method
   in the proof file of step 7, KeY shows:
	Nodes				3,072
	Branches			23
	Interactive steps		0
	Symbolic execution steps	19
	etc.

One may open all proof files in this manner to see their proof trees and statistics.

### Troubleshooting

In case a different KeY version was used by the same user on the same machine, certain configuration files may cause the bundled KeY version not to load the proof files, possibly showing a `NullPointerException`. In that case, follow step 3 above.